home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Complete Windows Set
/
The Complete Windows Set.iso
/
MICROLIN
/
HOST.MSL
< prev
next >
Wrap
Text File
|
1992-04-13
|
14KB
|
436 lines
' Host mode script
' Access levels are: 3 - Sysop
' 2 - user can access any directory
' 1 - user can access only current directory
PUSH
SET ECHO ON
SET TEXTWRAP ON
SET HOSTECHO ON
SET INCRLF ON
SET OUTCRLF ON
SET CARRIERDETECT ON
upload_dir$ = uploaddirectory
default_dir$ = defaultdirectory
file_spec$ = filespec
cr$ = "^M"
cr2$ = "^M^M"
cr3$ = "^M^M^M"
cr4$ = "^M^M^M^M"
cr5$ = "^M^M^M^M^M"
newpage$ = cr5$+cr5$+cr5$+cr5$+cr5$
Header$ = " Host Mode"
welcome1$ = " ***********************************"+cr$
welcome2$ = " * Microlink Host Mode *"+cr$
welcome3$ = " * Press ENTER to Continue *"+cr$
welcome4$ = " ***********************************"+cr5$
continue = 1
max_lines = 20
WHILE continue=1
if ChangeDirectory(default_dir$) > 0 then
mprint "Invalid default directory"
beep
sleep 5
continue = 0
GOTO force_hangup
endif
current_dir$ = default_dir$
ONERROR force_hangup
AUTOANSWER
' Computer answered phone
sleep 5
IF Connected = 0 Then
goto force_hangup
endif
RPRINT newpage$
RPRINT welcome1$
RPRINT welcome2$
RPRINT welcome3$
RINPUT welcome4$,temp$
Rprint cr4$
' Prompts to enter password
logon_ok = 0
set error off
FOR i = 1 TO 3
onerror skipsignon
RINPUT cr$+"Enter FIRST name: ", first$
RINPUT cr$+"Enter LAST name: ", last$
SET HOSTECHO OFF
RINPUT cr$+"Enter PASSWORD: ", password$
set error off
SET HOSTECHO ON
logon_ok = VerifyUser(first$, last$, password$)
IF logon_ok > 1 THEN
IF OPENHOST = 1 THEN
onerror skipnew
rprint cr2$+" N E W U S E R"+cr2$
Rprint cr$+"First Name: "+first$
Rprint cr$+"Last Name: "+last$
RINPUT cr$+"Correct? ", Temp$
logon_ok = 0
IF upper(Temp$) = "Y" THEN
IF Adduser(first$, last$, password$, 1) > 0 THEN
RPRINT cr2$+"Unable To Add User At This Time"
logon_ok = 1
ENDIF
EXIT
ENDIF
skipnew:
ELSE
RPRINT cr2$+"Invalid logon attempt!"
IF i < 3 THEN
RPRINT cr$+"There are " + String(3 - i) + " attempts left."
ENDIF
ENDIF
ELSE
IF logon_ok = 1 THEN
RPRINT cr$+"Invalid logon attempt!"
IF i < 3 THEN
RPRINT cr$+"There are " + String(3 - i) + " attempts left." + cr$
ENDIF
ELSE
EXIT
ENDIF
ENDIF
skipsignon:
NEXT
IF logon_ok > 0 THEN
RPRINT cr2$+"Unable to validate user!"
RPRINT cr2$+"Hanging up!"
goto force_hangup
else
continue_commands = 1
access_level = ExtractUserLevel(first$, last$)
rprint cr4$
endif
WHILE continue_commands = 1
if Connected = 0 then
EXIT
endif
RPRINT cr2$+" Host Mode Processor"+cr2$
RPRINT cr$ + "[F]File Directory [D]Download [U]Upload"
' Level 2 or 3
IF access_level > 1 THEN
RPRINT cr$ + "[CD]Change Directory [FS]File Specification"
ENDIF
' Level 3 only
IF access_level > 2 then
RPRINT cr$ + "[AU]Add User [CU]Change User"
RPRINT cr$ + "[DU]Delete User [S]ShutDown"
ENDIF
RPRINT cr$ + "[G]Goodbye"
' Wait for command
RINPUT cr2$+current_dir$ + "> ", tempcommand$
command$ = upper(tempcommand$)
' Exit System
if len(command$) = 1 then
IF command$ = "G" THEN
RPRINT cr$ + "Thanks for calling " + first$ + "!" + cr$
continue_commands = 0
SLEEP 2
ENDIF
' List Files
IF command$ = "F" THEN
RPRINT cr4$
RPRINT "Directory listing of: " + current_dir$ + cr2$
ChangeDirectory(current_dir$)
filename$ = GetFirstDirEntry(current_dir$, file_spec$)
WHILE Len(filename$) > 0
IF Connected = 0 Then
EXIT
endif
FOR i = 1 to max_lines
RPRINT filename$ + cr$
filename$ = GetNextDirEntry()
IF Len(filename$) = 0 THEN
EXIT
ENDIF
NEXT
IF LEN(filename$) > 0 THEN
Rinput cr$+"List paused. Press ENTER to continue.",temp$
IF "C" = upper(temp$) THEN
exit
ENDIF
rprint cr4$
ENDIF
WEND
RINPUT cr$+"End of List. Press ENTER to Continue",temp$
rprint cr4$
ENDIF
' Download a File
IF command$ = "D" THEN
rprint cr4$
WHILE 1 = 1
IF Connected = 0 Then
EXIT
endif
RPRINT cr$+Header$+cr3$
RPRINT cr$+"Available download file transfer protocols:" + cr2$
RPRINT "[X]..XMODEM Checksum" + cr$
RPRINT "[C]..XMODEM CRC" + cr$
RPRINT "[Y]..YMODEM 1K" + cr$
RPRINT "[YB].YMODEM Batch" + cr$
RPRINT "[YG].YMODEM G" + cr$
RPRINT "[Z]..ZMODEM" + cr$
RPRINT "[E]..Cancel" + cr$
RINPUT "Select protocol: ", tempchoice$
choice$ = upper(tempchoice$)
if len(choice$) = 1 then
IF choice$ = "E" THEN
EXIT
ENDIF
IF choice$ = "X" THEN
set protocol XMODEM
EXIT
ENDIF
IF choice$ = "C" THEN
set protocol XMODEMCRC
EXIT
ENDIF
IF choice$ = "Y" THEN
set protocol YMODEM
EXIT
ENDIF
IF choice$ = "Z" THEN
set protocol ZMODEM
EXIT
ENDIF
endif
if len(choice$) = 2 then
IF choice$ = "YB" THEN
set protocol YMODEMB
EXIT
ENDIF
IF choice$ = "YG" THEN
set protocol YMODEMG
EXIT
ENDIF
ENDIF
rprint cr2$+"Invalid Selection"+cr2$
WEND
IF choice$ = "E" THEN
rprint "Canceled!"+cr$
ELSE
ChangeDirectory(current_dir$)
RINPUT cr2$+"Enter Filename: ", transfer_file$
is_ok = DoesFileExist(transfer_file$)
IF is_ok = 1 THEN
RPRINT cr$+"File " + transfer_file$ + " was not found." + cr$
RPRINT "File transfer canceled!" + cr$
ELSE
RPRINT cr$+"Downloading " + transfer_file$ + cr$
ONERROR snderr
SEND transfer_file$
sleep 3
rprint cr$+"File Transfer Successful"
goto sndok
snderr:
rprint cr2$+"Error Downloading File"
rinput cr$+"Hit ENTER to Continue",temp$
sndok:
set error off
ENDIF
ENDIF
ENDIF
' Receive a File
IF command$ = "U" THEN
rprint cr4$
WHILE 1 = 1
IF Connected = 0 Then
EXIT
endif
RPRINT cr$+Header$+cr3$
RPRINT "Available Upload file transfer protocols:" + cr2$
RPRINT "[X]..XMODEM Checksum" + cr$
RPRINT "[C]..XMODEM CRC" + cr$
RPRINT "[Y]..YMODEM 1K" + cr$
RPRINT "[YB].YMODEM Batch" + cr$
RPRINT "[YG].YMODEM G" + cr$
RPRINT "[Z]..ZMODEM" + cr$
RPRINT "[E]..Exit" + cr$
RINPUT "Select protocol: ", tempchoice$
choice$ = upper(tempchoice$)
if len(choice$) = 1 then
IF choice$ = "E" THEN
EXIT
ENDIF
IF choice$ = "X" THEN